<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>
<%@ page import="com.ionglobal.cms.*" %>
<%@ include file="../check_right.jsp" %>	
<%@ include file="../init_include.jsp" %>

<%

	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid","000000010"); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS)
	{
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}	

	int catid=0;
	if(request.getParameter("catid")!=null)
		catid=Integer.parseInt(request.getParameter("catid"));
	int id=0,curcategory=7;
	if(request.getParameter("curcategory")!=null)
		curcategory=Integer.parseInt(request.getParameter("curcategory"));
	if(request.getParameter("id")!=null)
		id=Integer.parseInt(request.getParameter("id"));
	Vector vc=Tree.getLocalTree(dbi,curcategory);
	ItemData ca;
	int firstlayer=0;
%>
<HTML>
<HEAD>
<link rel="stylesheet" href="../css.css" type="text/css">
</HEAD>
<SCRIPT language=JavaScript1.2 src="../script/Ion_Show.js"></SCRIPT>
<script language="javascript">
<!--
-->
</script>
<body bgColor=#d6d3ce leftMargin=0 
style="BORDER-BOTTOM: 0px outset; BORDER-LEFT: 0px outset; BORDER-RIGHT: 0px outset; BORDER-TOP: 0px outset" 
topMargin=0>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr><td><%=Language.getNameByCode("sys.category.privilegelist","Category Privilege List")%></td></tr>
</table>
<TABLE border=0 cellPadding=0 cellSpacing=1 height="100%" width="100%">
	<FORM name="formIon" method="post" action="showCategoryRight.jsp">
		<input type="hidden" name="catid" value="<%=catid%>">
		<input type="hidden" name="curcategory" value="<%=curcategory%>">
		<input type="hidden" name="id" value="<%=catid%>">
		<INPUT name="objid" type="hidden">
		<INPUT name="objtext" type="hidden">
		<INPUT name="actionurl" type="hidden">
		<input type="hidden" name="orderfield" value="id">
		<input type="hidden" name="ordermode" value="desc">		
	<TR><TD>
   <%
   DictApp da=new DictApp();
   Properties TypeP=da.getDictProperties(dbi,"ProjectType",1,0,"sName","asc");
   Properties StatusP=da.getDictProperties(dbi,"ProjectStatus",1,0,"sName","asc");
    
   Table table=new Table();
   table.setSortMode("desc");
//out.println("id="+id);
   table.setSortField("id");
   table.setSelectionMode("multiple");

   table.addColumn("no","id",0,"center","left","number");
   table.addColumn(Language.getNameByCode("sys.category","Category"),"name",300,"center","left","text");
   table.addColumn(Language.getNameByCode("sys.class","Group"),"group",100,"center","left","text");

    ArrayList rowsList=new ArrayList();
    try {
     String rowData="";
     for(int i=0;i<vc.size();i++) {
      	String curgroup="";
		ca=(ItemData)vc.get(i);
		if(i==0)
			firstlayer=ca.layer;		
		curgroup=Category.getCategoryGroup(dbi,ca.id);
		String spacestr="";
		for(int j=0;j<ca.layer-firstlayer;j++)
			spacestr=spacestr+">>";
     
	 	rowData=ca.id+"|"+(spacestr+ca.name)+"|"+curgroup;
        rowsList.add(rowData);
     }
    } catch(Exception E) {
    }
    ArrayList menuList=new ArrayList();
    TableMenu tm=null;

    tm=new TableMenu(Language.getNameByCode("sys.category.grantpriviulege","Grant Privilege To Group"),"javascript:editIon('vmsSelectFrame.jsp','select_single_class.jsp','"+Language.getNameByCode("sys.category","Category")+"');",true);
    menuList.add(tm);
    tm=new TableMenu(Language.getNameByCode("sys.Head.Refresh","Refresh"),"javascript:self.location.reload();",false);
    menuList.add(tm);
  
    table.setTableMenu(menuList);
    table.setRowsList(rowsList);
    TableDB tdb=new TableDB();
    out.print(tdb.draw(table));
    %>

   </TD></TR>
   </form>
</table>
	
</body>
</HTML>
<%@ include file="../init_free.jsp" %>	

